package com.eastfair.pay.chinaums.common.utils;

import cn.hutool.core.date.LocalDateTimeUtil;

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author linan
 */
public class MerOrderIdUtil {

    public static final String SOURCE_CODE = "34VY";

    public static String getMerOrderId(){
        String sdf = LocalDateTimeUtil.format(LocalDateTime.now(),"yyyyMMddmmHHssSSS");
        return SOURCE_CODE+sdf+getRandom(7);
    }


    public static String getRandom(int len){
        long rs =(long)((Math.random()*9+1)*Math.pow(10,len-1));
        return String.valueOf(rs);
    }
}
